import React from "react";
import {Image, ImageSourcePropType} from "react-native";

type ImageIconProps = {
    source: ImageSourcePropType,
    size?: number,
    color?: string,
    resizeMode?: 'cover' | 'contain' | 'stretch' | 'repeat' | 'center'
}
const ImageIcon = (props: ImageIconProps) => {
    const {
        source,
        size = 16,
        color = '#fff',
        resizeMode = 'cover'
    } = props;
    return (
        <Image
            source={source}
            style={{
                width: size,
                height: size,
                tintColor: color
            }}
            resizeMode={resizeMode}
        />
    );
};

export default React.memo(ImageIcon);
